/******************************************************************************
//             INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in accordance with the terms of that agreement.
//        Copyright (c) 2000-2001 Intel Corporation. All Rights Reserved.
//
//  Description:
//      Intel(R) JPEG library for X platform 
//
********************************************************************************/
#ifndef __IJX_H
#define __IJX_H

#include "ippdefs.h"
#include "_ijxdefs.h"
#include "ijx.h"
#include "ijcp.h"

#include "ijfreq.h"
#include "ijtable.h"

#include "ijetrans.h"
#include "ijemark.h"
#include "ijehuff.h"
#include "ijefrm.h"
#include "ijescan.h"
#include "ijecode.h"
#include "ijemdiff.h"

#include "ijdtrans.h"
#include "ijdmark.h"
#include "ijdhuff.h"
#include "ijdfrm.h"
#include "ijdscan.h"
#include "ijdcode.h"
#include "ijdmdiff.h"

#include "sys/time.h"

#ifdef _DEBUG
    #ifdef WIN32
		#include <assert.h>
		#define IJX_ASSERT(x) assert(x)
	#else
		#define IJX_ASSERT(x) (0)
    #endif
#else
    #define IJX_ASSERT(x) (0)
#endif    

struct timeval tv_iqit;
struct timeval tv_iqit0;
struct timeval tv_iqit1;
struct timeval tv_vld0;
struct timeval tv_vld1;
struct timeval tv_vld;
struct timeval tv_cc;
struct timeval tv_cc0;
struct timeval tv_cc1;

void ijAdjustStream(IJBITTREAMSTATE *pStream);

IJXRESULT ijWriteStreamBytes(void * pSrcData, 
                              int nBytesLen,
                              IJBITTREAMSTATE *pStream);

IJXRESULT ijReadStreamBytes(void * pSrcData, 
                            int nBytesLen, 
                            IJBITTREAMSTATE *pStream);

void ijInitFrameComponents(int nNumComp, IJCOMPSPEC *pCompSpec);
                          
void ijInitComponentSpec(int nIdentifier, 
                         int nHSampling, 
                         int nVSampling, 
                         int nQuantIndex, 
                         int nDCHuffTableIndex, 
                         int nACHuffTableIndex,
                         IJCOMPSPEC *pCompSpec);

void ijInitMCU(int       nImageWidth,
               int       nImageHeight,
               int       nMCUWidth,
               int       nMCUHeight,
               int       nImageMCUStep,
               int       nBlksInMCU,
               int       nSubSamplingMode,
               BOOL      bMCUInterleaved,
               IJMCUSPEC *pMCUSpec);

IJXRESULT ijInitBuffers(void         *pBufPtr, 
                        int          nBufLen,
                        IJBUFFER     *pBuffer,
                        IJMCUSPEC    *pMCUSpec,
                        IIPIMAGESPEC *pImageSpec);

void ijResetBuffers(IJBUFFER *pIJXBuffer);


void ijZeroMemory_4BYTE(void *pSrc, int len);
void ijZeroMemory_1BYTE(void *pSrc, int len);

#endif
/* EOF */

